/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSky.support;

/**
 *
 * @author Rakev
 */
public enum RomeNumber {

    I, II, III, IV, V, VI, VII, VIII, IX, X,
    XI,XII,XIII,XIV,XV,XVI,XVII,XVIII,XIX,XX,
    XXI,XXII,XXIII,XXIV,XXV,XXVI,XXVII,XXVIII,XXIX,XXX,
    XXXI,XXXII,XXXIII,XXXIV,XXXV,XXXVI,XXXVII,XXXVIII,XXXIX,XXXX,
    XXXXI,XXXXII,XXXXIII,XXXXIV,XXXXV,XXXXVI,XXXXVII,XXXXVIII,XXXXIX,XXXXX;

    public int getValue() {
        return ordinal() + 1;
    }

    public static RomeNumber parse(int i) {
        if (i > 0 && i <= RomeNumber.values().length) {
            return RomeNumber.values()[i - 1];
        }
        throw new IllegalArgumentException("The number should be in the range from 0 to " + (values().length + 1));
    }
}
